Skip to content

add PromiseRejectionEvent from WHATWG Living Standard #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 2, 2017

Conversation

tuures
Copy link
Contributor

@tuures tuures commented Jan 11, 2017

@msftclas
Copy link

Hi @tuures, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@msftgits
Copy link

Hi, I am closing and re-opening this PR to bump the CLA bot. Sorry for the inconvenience!

@msftgits msftgits closed this Jan 11, 2017
@msftgits msftgits reopened this Jan 11, 2017
@msftclas
Copy link

Hi @tuures, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
We will now validate the agreement and then real humans will evaluate your PR.

TTYL, MSBOT;

@zhengbli
Copy link
Contributor

zhengbli commented Feb 2, 2017

👍

@zhengbli zhengbli merged commit 92f4c64 into microsoft:master Feb 2, 2017
@ghost
Copy link

ghost commented Mar 31, 2017

i think it's missing the declare var PromiseRejectionEvent part

function getErrorEventText (event: ErrorEvent | PromiseRejectionEvent) {
	
	if (event instanceof ErrorEvent) {
		return event.message;
	}
	
	// [ts] 'PromiseRejectionEvent' only refers to a type, but is being used as a value here.
	if (event instanceof PromiseRejectionEvent) {
		return String(event.reason);
	}
	
	return "<unknown error>";
	
}

i had to put this in my code (modified from ErrorEvent):

declare var PromiseRejectionEvent: {
    prototype: PromiseRejectionEvent;
    new(type: string, promiseRejectionEventInitDict?: PromiseRejectionEventInit): PromiseRejectionEvent;
}

@zhengbli
Copy link
Contributor

Hi @epicgirl1998 do you mind send another PR to fix this! Help is appreciated. Thank you!

@ghost
Copy link

ghost commented Mar 31, 2017

i would like to contribute but i can't seem to find any documentation for the input json files (how do all the other contributors know what to do? or am i just missing something?)

@zhengbli
Copy link
Contributor

The general overview is at https://github.com/Microsoft/TSJS-lib-generator/blob/master/README.md
You can refer to json format used by other types in the json file to figure out what you need to add.

For this case, I think it should be sufficient to add a "constructorSignatures" to this json. Similar example can be found at:
https://github.com/Microsoft/TSJS-lib-generator/blob/master/inputfiles/addedTypes.json#L184

@ghost ghost mentioned this pull request Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants